package tpo.lmhprovider.lmhprovider.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import pojo.Unit;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface UnitMapper {

    List<Unit> getUnit(Map map);

    @Update("update unit set name=#{name} where id=#{id}")
    int updateUnit(Map map);

    @Insert("insert into unit (name) values(#{name})")
    int addUnit (Map map);

    @Delete("delete from unit where id=#{id}")
    int delUnit(Map map);
}
